package ru.vboxdc.actions;

import com.opensymphony.xwork2.ActionSupport;
import ru.vboxdc.ObjectPool;
import ru.vboxdc.domain.HostServer;
import ru.vboxdc.domain.VirtualMachine;


/**
 * User: lelon
 * Date: 01.02.2009
 * Time: 3:12:05
 */

public class VirtualMachineInfo extends ActionSupport {

    private int id;
    private ObjectPool objectPool = ObjectPool.get();

    private VirtualMachine virtualMachine;


    public String execute () {
        virtualMachine = objectPool.getVirtualMachine(id);
        if (virtualMachine==null) addActionError(String.format(getText("VirtualMachine.not.found"), id));
        return SUCCESS;
    }

    public void setId(int id) {
        this.id = id;
    }


    public VirtualMachine getVirtualMachine() {
        return virtualMachine;
    }



}